package com.hjxy.controller;

import com.hjxy.pojo.Student;
import com.hjxy.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @description:
 * @author: ty
 * @createDate: 2020/9/28
 * @version: 1.0
 */
@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/test1")
    @ResponseBody
    public String test(Model model){
        Model model1 = model.addAttribute("msg", "整合成功");
        List<Student> students = studentService.queryAllStudent();
        System.out.println(students);
        System.out.println(model1);
        return "welcome";
    }
}
